package com.lagou.sort;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @author lcy
 * @description 排序MAP
 * @date 2021/11/6 23:27
 * @vserion 1.3.3
 */
public class SortMapper extends Mapper<LongWritable, Text, LongWritable, LongWritable> {
	@Override
	protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, LongWritable, LongWritable>.Context context) throws IOException, InterruptedException {

		// 读取的文本当作key,    并且给到默认的行数1
		context.write(new LongWritable(Integer.parseInt(value.toString())), new LongWritable(1));

	}
}
